﻿<Window x:Class="Mosaic.Windows.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Properties="clr-namespace:Mosaic.Properties"
        xmlns:Core="clr-namespace:Mosaic.Core;assembly=Mosaic.Core" Title="MainWindow" Height="300" Width="300"
        WindowStyle="None" ResizeMode="NoResize" AllowsTransparency="True" Background="Transparent" ShowInTaskbar="False" 
        SourceInitialized="WindowSourceInitialized"  Loaded="WindowLoaded" Closing="WindowClosing" MouseLeftButtonUp="WindowMouseLeftButtonUp">
    <Window.Resources>
        <Storyboard x:Key="ArrowAnimLeft">
            <DoubleAnimation Storyboard.TargetName="MenuButtonRotate" Storyboard.TargetProperty="Angle" To="-180" Duration="0:0:0.3" BeginTime="0:0:0.1"/>
            <ThicknessAnimation Storyboard.TargetName="UserMenuPanel" Storyboard.TargetProperty="Margin" To="0,50,170,0" Duration="0:0:0.3" AccelerationRatio="0.5" DecelerationRatio="0.3"/>
        </Storyboard>
        <Storyboard x:Key="ArrowAnimRight">
            <DoubleAnimation Storyboard.TargetName="MenuButtonRotate" Storyboard.TargetProperty="Angle" To="0" Duration="0:0:0.3" BeginTime="0:0:0.1"/>
            <ThicknessAnimation Storyboard.TargetName="UserMenuPanel" Storyboard.TargetProperty="Margin" To="0,50,50,0" Duration="0:0:0.6" AccelerationRatio="0.5" DecelerationRatio="0.3"/>
        </Storyboard>
        <Storyboard x:Key="SlideAnim" Completed="SlideAnimCompleted">
            <!--<DoubleAnimation Storyboard.TargetName="FakeDesktopTranslate" Storyboard.TargetProperty="X" Duration="0:0:0.5" BeginTime="0:0:0.1" DecelerationRatio="0.3" AccelerationRatio="0.7"/>-->
            <DoubleAnimation Storyboard.TargetName="FakeDesktopImage" Storyboard.TargetProperty="(Canvas.Left)" Duration="0:0:0.5" BeginTime="0:0:0.1" DecelerationRatio="0.3" AccelerationRatio="0.7"/>
            <ThicknessAnimation Storyboard.TargetName="DragScroll" Storyboard.TargetProperty="Margin" To="0" Duration="0:0:0.5" BeginTime="0:0:0.1" DecelerationRatio="0.7" AccelerationRatio="0.3"/>
        </Storyboard>
    </Window.Resources>
    <Grid Name="LayoutRoot">
        <Image Name="BackgroundImage" Stretch="UniformToFill" VerticalAlignment="Bottom" Margin="0,-10,0,0">
            <Image.RenderTransform>
                <TransformGroup>
                    <TranslateTransform x:Name="BackgroundImageTranslate"/>
                    <ScaleTransform x:Name="BackgroundImageScale"/>
                </TransformGroup>
            </Image.RenderTransform>
        </Image>
        <!--<Rectangle Name="BackgroundImageOverlay" Opacity="0.6" Visibility="Collapsed">
            <Rectangle.Fill>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <GradientStop Color="Black" Offset="0"/>
                    <GradientStop Color="#00000000" Offset="0.4"/>
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>-->
        <Core:DragScrollViewer x:Name="DragScroll" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Hidden">
            <Grid Name="WidgetHost" ShowGridLines="False">
                <TextBlock Name="MosaicTitle" Grid.Column="1" Grid.Row="0" Text="Mosaic" FontWeight="Light" FontSize="58" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3,0,0,0"/>
            </Grid>
        </Core:DragScrollViewer>
        <StackPanel Name="UserMenuPanel" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="50">
            <DockPanel>
                <StackPanel Name="UserPanel" DockPanel.Dock="Left" HorizontalAlignment="Right">
                    <TextBlock Name="Username" Foreground="White" FontWeight="Light" FontSize="28" Text="User" TextAlignment="Right"/>
                    <TextBlock Name="MachineName" Foreground="White" FontWeight="Light" FontSize="16" Text="Machine" TextAlignment="Right"/>
                </StackPanel>
                <Image Name="Userpic" Width="55" Height="55" Margin="10,5,20,0"/>
            </DockPanel>
            <Image Name="MenuButton" Source="/Resources/menu_icon.png" Width="48" RenderTransformOrigin="0.5,0.5" MouseLeftButtonUp="MenuButtonMouseLeftButtonUp">
                <Image.RenderTransform>
                    <RotateTransform x:Name="MenuButtonRotate"/>
                </Image.RenderTransform>
            </Image>
        </StackPanel>
        <Canvas Name="DragCanvas">
            <Image Name="FakeDesktopImage" VerticalAlignment="Top" HorizontalAlignment="Left" Stretch="UniformToFill" Canvas.Left="0">
                <Image.RenderTransform>
                    <TranslateTransform x:Name="FakeDesktopTranslate"/>
                </Image.RenderTransform>
            </Image>
        </Canvas>
    </Grid>
</Window>
